package mac5855.app.dao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JpaDAOFactory extends DAOFactory {

	// method to create Jdbc connections
	public static EntityManager createConnection() {
		EntityManagerFactory emf;
		EntityManager em;
		// Use DRIVER and DBURL to create a connection
		// Recommend connection pool implementation/usage
		emf = Persistence.createEntityManagerFactory("examplePersistenceUnit");
		em = emf.createEntityManager();

		return em;
	}

	public static void releaseConnection(EntityManager em) {
		em.close();
	}

	@Override
	public CategoriaDAO getCategoriaDAO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public DenunciaDAO getDenunciaDAO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public PerguntaDAO getPerguntaDAO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public RespostaDAO getRespostaDAO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public UsuarioDAO getUsuarioDAO() {
		// TODO Auto-generated method stub
		return null;
	}

}
